﻿/*************************************************************************
* @File			:	Singleton.cs
* @Description	:
*
*
*
*
************************************************************************/
using System;

namespace Framework
{
    // -----------------------------------------------------------------------
    // @brief 单例
    public class Singleton<T> where T : class, new()
    {
        protected static T instance;

        public static T Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = (T)Activator.CreateInstance(typeof(T), true);
                }

                return instance;
            }
        }
    }
}


